<?php

class SomeObject {
    private $value1 = "XXX";
    private $value2 = "YYY";
    private $value3 = "ZZZ";
     
    public function getValue1() {
        return $this->value1;
    }

    public function setValue1($value1) {
        $this->value1 = $value1;
    }

    public function getValue2() {
        return $this->value2;
    }

    public function setValue2($value2) {
        $this->value2 = $value2;
    }

    public function getValue3() {
        return $this->value3;
    }

    public function setValue3($value3) {
        $this->value3 = $value3;
    }

}

class sqlPersistenceTest extends ModuleModel {
    public function storeSomething() {
        $value = new SomeObject();
        
        $query = ModulesContext::instance()->getQueryFactory()->getQuery();
        $query->insertInto("something")
                ->set("name", "Something Jr")
                ->set("somethingToSay", serialize($value))
                ->commit();
    }
    
    public function loadSomething() {
        $query = ModulesContext::instance()->getQueryFactory()->getQuery();
        $query->select()->from(array("something"));
        $result = $query->get()->firstRow();
        var_dump($result);
        $object = unserialize($result["somethingToSay"]);
        var_dump($object);
    }
}
?>
